/*
 * Properties.h
 *
 *  Created on: Aug 25, 2011
 *      Author: mengwei.chua
 */

#ifndef PROPERTIES_H_
#define PROPERTIES_H_

#include <deque>
#include <map>
#include "util/IXmlParsable.h"

namespace projectcos
{
namespace tile
{
namespace parser
{

struct Property
{
	std::string name;
	std::string value;

	Property(const std::string& name, const std::string value)
	{
		this->name = name;
		this->value = value;
	}
};

typedef std::map<std::string, std::string> PropertyMap;

class Properties : public projectcos::util::IXmlParsable
{
public:
	Properties();
	virtual ~Properties();

	virtual bool Parse(const TiXmlElement* element);

	void GetPropertyList(std::deque<Property>& propertyList) const;
	std::string GetValue(const std::string& name) const;

protected:
private:
	PropertyMap m_PropertyList;
};

} // parser
} // tile
} // projectcos


#endif /* PROPERTIES_H_ */
